import ItemMoudle from "@/components/common/ItemModule"
import TableIndex from "@/components/common/TableIndex"
import TitleMain from "@/components/common/TitleMain"
import type { ColumnsType } from "antd/es/table"


interface DataType {
  type: string
  time: string
  AIP: string
  key: string
  BIP: string
  name: string
  grade:string
}

const columns: ColumnsType<DataType> = [

  {
    title: '攻击时间',
    dataIndex: 'time',
    ellipsis: true,
    width: 90

  },
  {
    title: '攻击IP',
    dataIndex: 'AIP',
    width: 90
  },
  {
    title: '被攻击IP',
    dataIndex: 'BIP',
    width: 90
  },
  {
    title: '事件类型',
    dataIndex: 'type',
    width: 70
  },
  {
    title: '风险等级',
    dataIndex: 'grade',
    width: 70
  },
  {
    title: '运营商',
    dataIndex: 'name',
    width: 70
  },
];

const dataSource: DataType[] = [];
for (let i = 0; i < 46; i++) {
  dataSource.push({
    time:'2025/7/3 16:00:00',
    type: `远程代码执行`,
    grade: `高风险`,
    AIP:'118.43.212.42',
    BIP:'118.43.212.42',
    key: `${i}`,
    name:'移动'
  });
}
const WarningData = () => {
  return <ItemMoudle
    className="w-full"
    childClassName="h-[375px] flex items-center justify-between"
    header={
      <TitleMain title="警告数据" size='large'/>
    }
  >
     <TableIndex<DataType>
      columns={columns}
      data={dataSource}
      scroll={{ y: 300, x: 360 }}
    />



  </ItemMoudle>
}

export default WarningData